<!--
  Generated template for the ExerciseAnswerPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>

  <ion-navbar color="mainColor">
    <ion-title>{{exerciseTypeStr}}</ion-title>
  </ion-navbar>

</ion-header>


<ion-content padding>
  <div class="question_content">{{exerciseNo}}、{{exercise_name}}</div>
  <div class="question_img" *ngIf="exercise_image!=null"><img style="width: 100%" [src]="exercise_image"></div>
  <div class="isover"><span [class]='flg ? "over": "unover"' *ngIf="counterShow"> {{ counterText }}</span></div>
  <div class="perfect_answer" *ngIf="start_answer==0&&classType=='60003'&&showExcellent">
    <span>最佳答案</span>
    <p>学生：{{excellentAnswerStudent}}</p>
    <p>学号：{{excellentAnswerStuNo}}</p>
    <p>答案：{{excellentAnswer}}</p>
  </div>
  <div></div>
  <!--  <div *ngIf="start_answer==1">答题中</div>
    <div *ngIf="start_answer==0">已结束</div>-->
  <!--文本题显示-->
  <div class="item-textarea" *ngIf="(exerciseType=='10004'||exerciseType=='10006')&&answer_type==0">
    <textarea id="textArea" rows="10" placeholder="请输入您的看法，限150字" maxlength="150" [(ngModel)]="area_answer"
              [readonly]="flg==1"></textarea>
    <div class="mic_btn" *ngIf="flg==0">
      <div [ngClass]="{'active': pressing}"  (click)="onPress()">
        <ion-icon  ios="ios-mic" md="md-mic"></ion-icon>
      </div>
      <p>点击语音答题</p>
    </div>
    <div class="mic_btn" *ngIf="flg==1">
      <div [ngClass]="{'active': pressing}" style="background: #666">
        <ion-icon ios="ios-mic" md="md-mic"></ion-icon>
      </div>
      <p>点击语音答题</p>
    </div>
  </div>
  <!--选择题显示-->
  <ul class="options"
      *ngIf="exerciseType=='10001'||exerciseType=='10002'||exerciseType=='10009'||exerciseType=='10008'">
    <li *ngFor="let item of cur_option">
      <div (click)="select(item.option_sort,exerciseType)"
           [class.selected]="selectOptionId.indexOf(item.option_sort)>=0">{{item.option_sort}}.{{item.option_content}}
      </div>
    </li>
  </ul>



  <div *ngIf="exerciseType=='10004'&&answer_type==1" style="overflow: hidden;margin-top: 2rem;">
    <button class="button button-block button_upload" (click)="uploadFile()" [disabled]="flg==1||canUpload==1" *ngIf="flg!=1">+</button>
    <div *ngFor="let item of showAnswerImagesArray;let i=index" class="imgbox">
      <div class="upload_img" *ngIf="item!=null&&item!=''&&exerciseType=='10004'">
        <img [src]="item">
      </div>
      <button class="button button-block button_remove" (click)="clearAnswerImage(answerImagesArray[i])" [disabled]="flg==1" *ngIf="item!=null&&item!=''&&flg!=1&&exerciseType=='10004'">×</button>
    </div>
  </div>
  <button class="button button-block button-submit" (click)="saveAnswer()" [disabled]="flg==1">提交/SUBMIT</button>
</ion-content>
